• milkdairyDataSet3.Designer.cs
  • project /
1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 // This code was generated
by a tool.
4 // Runtime Version:
4.0.30319.42000
5 //
6 // Changes to
this file may cause incorrect behavior and will be lost if
7 // the code
is regenerated.
8 // </auto-generated>
9 //------------------------------------------------------------------------------

10
11 #pragma warning disable
1591
12
13 namespace
MilkDairyManagementSystemCSharp {
14     
15     
16     ///
<summary>
17     ///
Represents a strongly typed in-memory cache of data.
18     ///</summary>

19     
[global::System.Serializable()]
20     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
21     
[global::System.ComponentModel.ToolboxItem(true)]
22     
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
23     
[global::System.Xml.Serialization.XmlRootAttribute("milkdairyDataSet3")]
24     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
25     
public partial class milkdairyDataSet3 : global::System.Data.DataSet {
26         
27         
private rateDataTable tablerate;
28         
29         
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
30         
31         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
32         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
33         
public milkdairyDataSet3() {
34             
this.BeginInit();
35             
this.InitClass();
36             
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
37             
base.Tables.CollectionChanged += schemaChangedHandler;
38             
base.Relations.CollectionChanged += schemaChangedHandler;
39             
this.EndInit();
40         }
41         
42         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
43         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
44         
protected milkdairyDataSet3(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
45                 
base(info, context, false) {
46             
if ((this.IsBinarySerialized(info, context) == true)) {
47                 
this.InitVars(false);
48                 
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
49                 
this.Tables.CollectionChanged += schemaChangedHandler1;
50                 
this.Relations.CollectionChanged += schemaChangedHandler1;
51                 
return;
52             }
53             
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
54             
if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
55                 
global::System.Data.DataSet ds = new global::System.Data.DataSet();
56                 ds.ReadXmlSchema(
new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
57                 
if ((ds.Tables["rate"] != null)) {
58                     
base.Tables.Add(new rateDataTable(ds.Tables["rate"]));
59                 }
60                 
this.DataSetName = ds.DataSetName;
61                 
this.Prefix = ds.Prefix;
62                 
this.Namespace = ds.Namespace;
63                 
this.Locale = ds.Locale;
64                 
this.CaseSensitive = ds.CaseSensitive;
65                 
this.EnforceConstraints = ds.EnforceConstraints;
66                 
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
67                 
this.InitVars();
68             }
69             
else {
70                 
this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
71             }
72             
this.GetSerializationData(info, context);
73             
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
74             
base.Tables.CollectionChanged += schemaChangedHandler;
75             
this.Relations.CollectionChanged += schemaChangedHandler;
76         }
77         
78         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
79         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
80         
[global::System.ComponentModel.Browsable(false)]
81         
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
82         
public rateDataTable rate {
83             
get {
84                 
return this.tablerate;
85             }
86         }
87         
88         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
89         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
90         
[global::System.ComponentModel.BrowsableAttribute(true)]
91         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
92         
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
93             
get {
94                 
return this._schemaSerializationMode;
95             }
96             
set {
97                 
this._schemaSerializationMode = value;
98             }
99         }
100         
101         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
102         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
103         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
104         
public new global::System.Data.DataTableCollection Tables {
105             
get {
106                 
return base.Tables;
107             }
108         }
109         
110         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
111         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
112         
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
113         
public new global::System.Data.DataRelationCollection Relations {
114             
get {
115                 
return base.Relations;
116             }
117         }
118         
119         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
120         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
121         
protected override void InitializeDerivedDataSet() {
122             
this.BeginInit();
123             
this.InitClass();
124             
this.EndInit();
125         }
126         
127         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
128         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
129         
public override global::System.Data.DataSet Clone() {
130             milkdairyDataSet3 cln = ((milkdairyDataSet3)(
base.Clone()));
131             cln.InitVars();
132             cln.SchemaSerializationMode =
this.SchemaSerializationMode;
133             
return cln;
134         }
135         
136         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
137         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
138         
protected override bool ShouldSerializeTables() {
139             
return false;
140         }
141         
142         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
143         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
144         
protected override bool ShouldSerializeRelations() {
145             
return false;
146         }
147         
148         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
149         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
150         
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
151             
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
152                 
this.Reset();
153                 
global::System.Data.DataSet ds = new global::System.Data.DataSet();
154                 ds.ReadXml(reader);
155                 
if ((ds.Tables["rate"] != null)) {
156                     
base.Tables.Add(new rateDataTable(ds.Tables["rate"]));
157                 }
158                 
this.DataSetName = ds.DataSetName;
159                 
this.Prefix = ds.Prefix;
160                 
this.Namespace = ds.Namespace;
161                 
this.Locale = ds.Locale;
162                 
this.CaseSensitive = ds.CaseSensitive;
163                 
this.EnforceConstraints = ds.EnforceConstraints;
164                 
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
165                 
this.InitVars();
166             }
167             
else {
168                 
this.ReadXml(reader);
169                 
this.InitVars();
170             }
171         }
172         
173         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
174         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
175         
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
176             
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
177             
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
178             stream.Position =
0;
179             
return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
180         }
181         
182         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
183         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
184         
internal void InitVars() {
185             
this.InitVars(true);
186         }
187         
188         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
189         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
190         
internal void InitVars(bool initTable) {
191             
this.tablerate = ((rateDataTable)(base.Tables["rate"]));
192             
if ((initTable == true)) {
193                 
if ((this.tablerate != null)) {
194                     
this.tablerate.InitVars();
195                 }
196             }
197         }
198         
199         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
200         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
201         
private void InitClass() {
202             
this.DataSetName = "milkdairyDataSet3";
203             
this.Prefix = "";
204             
this.Namespace = "http://tempuri.org/milkdairyDataSet3.xsd";
205             
this.EnforceConstraints = true;
206             
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
207             
this.tablerate = new rateDataTable();
208             
base.Tables.Add(this.tablerate);
209         }
210         
211         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
212         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
213         
private bool ShouldSerializerate() {
214             
return false;
215         }
216         
217         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
218         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
219         
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
220             
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
221                 
this.InitVars();
222             }
223         }
224         
225         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
226         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
227         
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
228             milkdairyDataSet3 ds =
new milkdairyDataSet3();
229             
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
230             
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
231             
global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
232             any.Namespace = ds.Namespace;
233             sequence.Items.Add(any);
234             type.Particle = sequence;
235             
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
236             
if (xs.Contains(dsSchema.TargetNamespace)) {
237                 
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
238                 
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
239                 
try {
240                     
global::System.Xml.Schema.XmlSchema schema = null;
241                     dsSchema.Write(s1);
242                     
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
243                         schema = ((
global::System.Xml.Schema.XmlSchema)(schemas.Current));
244                         s2.SetLength(
0);
245                         schema.Write(s2);
246                         
if ((s1.Length == s2.Length)) {
247                             s1.Position =
0;
248                             s2.Position =
0;
249                             
for (; ((s1.Position != s1.Length)
250                                         && (s1.ReadByte() == s2.ReadByte())); ) {
251                                 ;
252                             }
253                             
if ((s1.Position == s1.Length)) {
254                                 
return type;
255                             }
256                         }
257                     }
258                 }
259                 
finally {
260                     
if ((s1 != null)) {
261                         s1.Close();
262                     }
263                     
if ((s2 != null)) {
264                         s2.Close();
265                     }
266                 }
267             }
268             xs.Add(dsSchema);
269             
return type;
270         }
271         
272         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
273         
public delegate void rateRowChangeEventHandler(object sender, rateRowChangeEvent e);
274         
275         ///
<summary>
276         ///
Represents the strongly named DataTable class.
277         ///</summary>

278         
[global::System.Serializable()]
279         
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
280         
public partial class rateDataTable : global::System.Data.TypedTableBase<rateRow> {
281             
282             
private global::System.Data.DataColumn columnId;
283             
284             
private global::System.Data.DataColumn columnc_fate_rate;
285             
286             
private global::System.Data.DataColumn columnn_fate_rate;
287             
288             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
289             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
290             
public rateDataTable() {
291                 
this.TableName = "rate";
292                 
this.BeginInit();
293                 
this.InitClass();
294                 
this.EndInit();
295             }
296             
297             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
298             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
299             
internal rateDataTable(global::System.Data.DataTable table) {
300                 
this.TableName = table.TableName;
301                 
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
302                     
this.CaseSensitive = table.CaseSensitive;
303                 }
304                 
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
305                     
this.Locale = table.Locale;
306                 }
307                 
if ((table.Namespace != table.DataSet.Namespace)) {
308                     
this.Namespace = table.Namespace;
309                 }
310                 
this.Prefix = table.Prefix;
311                 
this.MinimumCapacity = table.MinimumCapacity;
312             }
313             
314             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
315             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
316             
protected rateDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
317                     
base(info, context) {
318                 
this.InitVars();
319             }
320             
321             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
322             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
323             
public global::System.Data.DataColumn IdColumn {
324                 
get {
325                     
return this.columnId;
326                 }
327             }
328             
329             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
330             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
331             
public global::System.Data.DataColumn c_fate_rateColumn {
332                 
get {
333                     
return this.columnc_fate_rate;
334                 }
335             }
336             
337             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
338             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
339             
public global::System.Data.DataColumn n_fate_rateColumn {
340                 
get {
341                     
return this.columnn_fate_rate;
342                 }
343             }
344             
345             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
346             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
347             
[global::System.ComponentModel.Browsable(false)]
348             
public int Count {
349                 
get {
350                     
return this.Rows.Count;
351                 }
352             }
353             
354             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
355             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
356             
public rateRow this[int index] {
357                 
get {
358                     
return ((rateRow)(this.Rows[index]));
359                 }
360             }
361             
362             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
363             
public event rateRowChangeEventHandler rateRowChanging;
364             
365             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
366             
public event rateRowChangeEventHandler rateRowChanged;
367             
368             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
369             
public event rateRowChangeEventHandler rateRowDeleting;
370             
371             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
372             
public event rateRowChangeEventHandler rateRowDeleted;
373             
374             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
375             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
376             
public void AddrateRow(rateRow row) {
377                 
this.Rows.Add(row);
378             }
379             
380             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
381             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
382             
public rateRow AddrateRow(string c_fate_rate, string n_fate_rate) {
383                 rateRow rowrateRow = ((rateRow)(
this.NewRow()));
384                 
object[] columnValuesArray = new object[] {
385                         
null,
386                         c_fate_rate,
387                         n_fate_rate};
388                 rowrateRow.ItemArray = columnValuesArray;
389                 
this.Rows.Add(rowrateRow);
390                 
return rowrateRow;
391             }
392             
393             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
394             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
395             
public rateRow FindById(int Id) {
396                 
return ((rateRow)(this.Rows.Find(new object[] {
397                             Id})));
398             }
399             
400             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
401             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
402             
public override global::System.Data.DataTable Clone() {
403                 rateDataTable cln = ((rateDataTable)(
base.Clone()));
404                 cln.InitVars();
405                 
return cln;
406             }
407             
408             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
409             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
410             
protected override global::System.Data.DataTable CreateInstance() {
411                 
return new rateDataTable();
412             }
413             
414             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
415             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
416             
internal void InitVars() {
417                 
this.columnId = base.Columns["Id"];
418                 
this.columnc_fate_rate = base.Columns["c_fate_rate"];
419                 
this.columnn_fate_rate = base.Columns["n_fate_rate"];
420             }
421             
422             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
423             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
424             
private void InitClass() {
425                 
this.columnId = new global::System.Data.DataColumn("Id", typeof(int), null, global::System.Data.MappingType.Element);
426                 
base.Columns.Add(this.columnId);
427                 
this.columnc_fate_rate = new global::System.Data.DataColumn("c_fate_rate", typeof(string), null, global::System.Data.MappingType.Element);
428                 
base.Columns.Add(this.columnc_fate_rate);
429                 
this.columnn_fate_rate = new global::System.Data.DataColumn("n_fate_rate", typeof(string), null, global::System.Data.MappingType.Element);
430                 
base.Columns.Add(this.columnn_fate_rate);
431                 
this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
432                                 
this.columnId}, true));
433                 
this.columnId.AutoIncrement = true;
434                 
this.columnId.AutoIncrementSeed = -1;
435                 
this.columnId.AutoIncrementStep = -1;
436                 
this.columnId.AllowDBNull = false;
437                 
this.columnId.ReadOnly = true;
438                 
this.columnId.Unique = true;
439                 
this.columnc_fate_rate.MaxLength = 50;
440                 
this.columnn_fate_rate.MaxLength = 50;
441             }
442             
443             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
444             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
445             
public rateRow NewrateRow() {
446                 
return ((rateRow)(this.NewRow()));
447             }
448             
449             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
450             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
451             
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
452                 
return new rateRow(builder);
453             }
454             
455             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
456             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
457             
protected override global::System.Type GetRowType() {
458                 
return typeof(rateRow);
459             }
460             
461             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
462             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
463             
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
464                 
base.OnRowChanged(e);
465                 
if ((this.rateRowChanged != null)) {
466                     
this.rateRowChanged(this, new rateRowChangeEvent(((rateRow)(e.Row)), e.Action));
467                 }
468             }
469             
470             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
471             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
472             
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
473                 
base.OnRowChanging(e);
474                 
if ((this.rateRowChanging != null)) {
475                     
this.rateRowChanging(this, new rateRowChangeEvent(((rateRow)(e.Row)), e.Action));
476                 }
477             }
478             
479             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
480             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
481             
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
482                 
base.OnRowDeleted(e);
483                 
if ((this.rateRowDeleted != null)) {
484                     
this.rateRowDeleted(this, new rateRowChangeEvent(((rateRow)(e.Row)), e.Action));
485                 }
486             }
487             
488             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
489             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
490             
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
491                 
base.OnRowDeleting(e);
492                 
if ((this.rateRowDeleting != null)) {
493                     
this.rateRowDeleting(this, new rateRowChangeEvent(((rateRow)(e.Row)), e.Action));
494                 }
495             }
496             
497             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
498             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
499             
public void RemoverateRow(rateRow row) {
500                 
this.Rows.Remove(row);
501             }
502             
503             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
504             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
505             
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
506                 
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
507                 
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
508                 milkdairyDataSet3 ds =
new milkdairyDataSet3();
509                 
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
510                 any1.Namespace =
"http://www.w3.org/2001/XMLSchema";
511                 any1.MinOccurs =
new decimal(0);
512                 any1.MaxOccurs =
decimal.MaxValue;
513                 any1.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
514                 sequence.Items.Add(any1);
515                 
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
516                 any2.Namespace =
"urn:schemas-microsoft-com:xml-diffgram-v1";
517                 any2.MinOccurs =
new decimal(1);
518                 any2.ProcessContents =
global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
519                 sequence.Items.Add(any2);
520                 
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
521                 attribute1.Name =
"namespace";
522                 attribute1.FixedValue = ds.Namespace;
523                 type.Attributes.Add(attribute1);
524                 
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
525                 attribute2.Name =
"tableTypeName";
526                 attribute2.FixedValue =
"rateDataTable";
527                 type.Attributes.Add(attribute2);
528                 type.Particle = sequence;
529                 
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
530                 
if (xs.Contains(dsSchema.TargetNamespace)) {
531                     
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
532                     
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
533                     
try {
534                         
global::System.Xml.Schema.XmlSchema schema = null;
535                         dsSchema.Write(s1);
536                         
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
537                             schema = ((
global::System.Xml.Schema.XmlSchema)(schemas.Current));
538                             s2.SetLength(
0);
539                             schema.Write(s2);
540                             
if ((s1.Length == s2.Length)) {
541                                 s1.Position =
0;
542                                 s2.Position =
0;
543                                 
for (; ((s1.Position != s1.Length)
544                                             && (s1.ReadByte() == s2.ReadByte())); ) {
545                                     ;
546                                 }
547                                 
if ((s1.Position == s1.Length)) {
548                                     
return type;
549                                 }
550                             }
551                         }
552                     }
553                     
finally {
554                         
if ((s1 != null)) {
555                             s1.Close();
556                         }
557                         
if ((s2 != null)) {
558                             s2.Close();
559                         }
560                     }
561                 }
562                 xs.Add(dsSchema);
563                 
return type;
564             }
565         }

566         
567         ///
<summary>
568         ///
Represents strongly named DataRow class.
569         ///</summary>

570         
public partial class rateRow : global::System.Data.DataRow {
571             
572             
private rateDataTable tablerate;
573             
574             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
575             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
576             
internal rateRow(global::System.Data.DataRowBuilder rb) :
577                     
base(rb) {
578                 
this.tablerate = ((rateDataTable)(this.Table));
579             }
580             
581             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
582             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
583             
public int Id {
584                 
get {
585                     
return ((int)(this[this.tablerate.IdColumn]));
586                 }
587                 
set {
588                     
this[this.tablerate.IdColumn] = value;
589                 }
590             }
591             
592             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
593             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
594             
public string c_fate_rate {
595                 
get {
596                     
try {
597                         
return ((string)(this[this.tablerate.c_fate_rateColumn]));
598                     }
599                     
catch (global::System.InvalidCastException e) {
600                         
throw new global::System.Data.StrongTypingException("The value for column \'c_fate_rate\' in table \'rate\' is DBNull.", e);
601                     }
602                 }
603                 
set {
604                     
this[this.tablerate.c_fate_rateColumn] = value;
605                 }
606             }
607             
608             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
609             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
610             
public string n_fate_rate {
611                 
get {
612                     
try {
613                         
return ((string)(this[this.tablerate.n_fate_rateColumn]));
614                     }
615                     
catch (global::System.InvalidCastException e) {
616                         
throw new global::System.Data.StrongTypingException("The value for column \'n_fate_rate\' in table \'rate\' is DBNull.", e);
617                     }
618                 }
619                 
set {
620                     
this[this.tablerate.n_fate_rateColumn] = value;
621                 }
622             }
623             
624             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
625             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
626             
public bool Isc_fate_rateNull() {
627                 
return this.IsNull(this.tablerate.c_fate_rateColumn);
628             }
629             
630             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
631             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
632             
public void Setc_fate_rateNull() {
633                 
this[this.tablerate.c_fate_rateColumn] = global::System.Convert.DBNull;
634             }
635             
636             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
637             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
638             
public bool Isn_fate_rateNull() {
639                 
return this.IsNull(this.tablerate.n_fate_rateColumn);
640             }
641             
642             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
643             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
644             
public void Setn_fate_rateNull() {
645                 
this[this.tablerate.n_fate_rateColumn] = global::System.Convert.DBNull;
646             }
647         }

648         
649         ///
<summary>
650         ///
Row event argument class
651         ///</summary>

652         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
653         
public class rateRowChangeEvent : global::System.EventArgs {
654             
655             
private rateRow eventRow;
656             
657             
private global::System.Data.DataRowAction eventAction;
658             
659             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
660             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
661             
public rateRowChangeEvent(rateRow row, global::System.Data.DataRowAction action) {
662                 
this.eventRow = row;
663                 
this.eventAction = action;
664             }
665             
666             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
667             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
668             
public rateRow Row {
669                 
get {
670                     
return this.eventRow;
671                 }
672             }
673             
674             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
675             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
676             
public global::System.Data.DataRowAction Action {
677                 
get {
678                     
return this.eventAction;
679                 }
680             }
681         }
682     }
683 }

684 namespace
MilkDairyManagementSystemCSharp.milkdairyDataSet3TableAdapters {
685     
686     
687     ///
<summary>
688     ///
Represents the connection and commands used to retrieve and save data.
689     ///</summary>

690     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
691     
[global::System.ComponentModel.ToolboxItem(true)]
692     
[global::System.ComponentModel.DataObjectAttribute(true)]
693     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
694         
", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
695     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
696     
public partial class rateTableAdapter : global::System.ComponentModel.Component {
697         
698         
private global::System.Data.SqlClient.SqlDataAdapter _adapter;
699         
700         
private global::System.Data.SqlClient.SqlConnection _connection;
701         
702         
private global::System.Data.SqlClient.SqlTransaction _transaction;
703         
704         
private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
705         
706         
private bool _clearBeforeFill;
707         
708         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
709         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
710         
public rateTableAdapter() {
711             
this.ClearBeforeFill = true;
712         }
713         
714         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
715         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
716         
protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
717             
get {
718                 
if ((this._adapter == null)) {
719                     
this.InitAdapter();
720                 }
721                 
return this._adapter;
722             }
723         }
724         
725         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
726         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
727         
internal global::System.Data.SqlClient.SqlConnection Connection {
728             
get {
729                 
if ((this._connection == null)) {
730                     
this.InitConnection();
731                 }
732                 
return this._connection;
733             }
734             
set {
735                 
this._connection = value;
736                 
if ((this.Adapter.InsertCommand != null)) {
737                     
this.Adapter.InsertCommand.Connection = value;
738                 }
739                 
if ((this.Adapter.DeleteCommand != null)) {
740                     
this.Adapter.DeleteCommand.Connection = value;
741                 }
742                 
if ((this.Adapter.UpdateCommand != null)) {
743                     
this.Adapter.UpdateCommand.Connection = value;
744                 }
745                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
746                     
if ((this.CommandCollection[i] != null)) {
747                         ((
global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
748                     }
749                 }
750             }
751         }
752         
753         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
754         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
755         
internal global::System.Data.SqlClient.SqlTransaction Transaction {
756             
get {
757                 
return this._transaction;
758             }
759             
set {
760                 
this._transaction = value;
761                 
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
762                     
this.CommandCollection[i].Transaction = this._transaction;
763                 }
764                 
if (((this.Adapter != null)
765                             && (
this.Adapter.DeleteCommand != null))) {
766                     
this.Adapter.DeleteCommand.Transaction = this._transaction;
767                 }
768                 
if (((this.Adapter != null)
769                             && (
this.Adapter.InsertCommand != null))) {
770                     
this.Adapter.InsertCommand.Transaction = this._transaction;
771                 }
772                 
if (((this.Adapter != null)
773                             && (
this.Adapter.UpdateCommand != null))) {
774                     
this.Adapter.UpdateCommand.Transaction = this._transaction;
775                 }
776             }
777         }
778         
779         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
780         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
781         
protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
782             
get {
783                 
if ((this._commandCollection == null)) {
784                     
this.InitCommandCollection();
785                 }
786                 
return this._commandCollection;
787             }
788         }
789         
790         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
791         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
792         
public bool ClearBeforeFill {
793             
get {
794                 
return this._clearBeforeFill;
795             }
796             
set {
797                 
this._clearBeforeFill = value;
798             }
799         }
800         
801         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
802         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
803         
private void InitAdapter() {
804             
this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
805             
global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
806             tableMapping.SourceTable =
"Table";
807             tableMapping.DataSetTable =
"rate";
808             tableMapping.ColumnMappings.Add(
"Id", "Id");
809             tableMapping.ColumnMappings.Add(
"c_fate_rate", "c_fate_rate");
810             tableMapping.ColumnMappings.Add(
"n_fate_rate", "n_fate_rate");
811             
this._adapter.TableMappings.Add(tableMapping);
812             
this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
813             
this._adapter.DeleteCommand.Connection = this.Connection;
814             
this._adapter.DeleteCommand.CommandText = @"DELETE FROM [dbo].[rate] WHERE (([Id] = @Original_Id) AND ((@IsNull_c_fate_rate = 1 AND [c_fate_rate] IS NULL) OR ([c_fate_rate] = @Original_c_fate_rate)) AND ((@IsNull_n_fate_rate = 1 AND [n_fate_rate] IS NULL) OR ([n_fate_rate] = @Original_n_fate_rate)))";
815             
this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
816             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Id", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
817             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_c_fate_rate", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "c_fate_rate", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
818             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_c_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "c_fate_rate", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
819             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_n_fate_rate", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "n_fate_rate", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
820             
this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_n_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "n_fate_rate", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
821             
this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
822             
this._adapter.InsertCommand.Connection = this.Connection;
823             
this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[rate] ([c_fate_rate], [n_fate_rate]) VALUES (@c_fate_rate, @n_" +
824                 
"fate_rate);\r\nSELECT Id, c_fate_rate, n_fate_rate FROM rate WHERE (Id = SCOPE_IDE" +
825                 
"NTITY())";
826             
this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
827             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@c_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "c_fate_rate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
828             
this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@n_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "n_fate_rate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
829             
this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
830             
this._adapter.UpdateCommand.Connection = this.Connection;
831             
this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[rate] SET [c_fate_rate] = @c_fate_rate, [n_fate_rate] = @n_fate_rate WHERE (([Id] = @Original_Id) AND ((@IsNull_c_fate_rate = 1 AND [c_fate_rate] IS NULL) OR ([c_fate_rate] = @Original_c_fate_rate)) AND ((@IsNull_n_fate_rate = 1 AND [n_fate_rate] IS NULL) OR ([n_fate_rate] = @Original_n_fate_rate)));
832 SELECT Id, c_fate_rate, n_fate_rate FROM rate WHERE (Id = @Id)"
;
833             
this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
834             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@c_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "c_fate_rate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
835             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@n_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "n_fate_rate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
836             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Id", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
837             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_c_fate_rate", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "c_fate_rate", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
838             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_c_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "c_fate_rate", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
839             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_n_fate_rate", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "n_fate_rate", global::System.Data.DataRowVersion.Original, true, null, "", "", ""));
840             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_n_fate_rate", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "n_fate_rate", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
841             
this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "Id", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
842         }
843         
844         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
845         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
846         
private void InitConnection() {
847             
this._connection = new global::System.Data.SqlClient.SqlConnection();
848             
this._connection.ConnectionString = global::MilkDairyManagementSystemCSharp.Properties.Settings.Default.milkdairyConnectionString;
849         }
850         
851         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
852         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
853         
private void InitCommandCollection() {
854             
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
855             
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
856             
this._commandCollection[0].Connection = this.Connection;
857             
this._commandCollection[0].CommandText = "SELECT Id, c_fate_rate, n_fate_rate FROM dbo.rate";
858             
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
859         }
860         
861         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
862         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
863         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
864         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
865         
public virtual int Fill(milkdairyDataSet3.rateDataTable dataTable) {
866             
this.Adapter.SelectCommand = this.CommandCollection[0];
867             
if ((this.ClearBeforeFill == true)) {
868                 dataTable.Clear();
869             }
870             
int returnValue = this.Adapter.Fill(dataTable);
871             
return returnValue;
872         }
873         
874         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
875         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
876         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
877         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
878         
public virtual milkdairyDataSet3.rateDataTable GetData() {
879             
this.Adapter.SelectCommand = this.CommandCollection[0];
880             milkdairyDataSet3.rateDataTable dataTable =
new milkdairyDataSet3.rateDataTable();
881             
this.Adapter.Fill(dataTable);
882             
return dataTable;
883         }
884         
885         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
886         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
887         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
888         
public virtual int Update(milkdairyDataSet3.rateDataTable dataTable) {
889             
return this.Adapter.Update(dataTable);
890         }
891         
892         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
893         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
894         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
895         
public virtual int Update(milkdairyDataSet3 dataSet) {
896             
return this.Adapter.Update(dataSet, "rate");
897         }
898         
899         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
900         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
901         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
902         
public virtual int Update(global::System.Data.DataRow dataRow) {
903             
return this.Adapter.Update(new global::System.Data.DataRow[] {
904                         dataRow});
905         }
906         
907         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
908         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
909         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
910         
public virtual int Update(global::System.Data.DataRow[] dataRows) {
911             
return this.Adapter.Update(dataRows);
912         }
913         
914         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
915         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
916         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
917         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
918         
public virtual int Delete(int Original_Id, string Original_c_fate_rate, string Original_n_fate_rate) {
919             
this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_Id));
920             
if ((Original_c_fate_rate == null)) {
921                 
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
922                 
this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
923             }
924             
else {
925                 
this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
926                 
this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_c_fate_rate));
927             }
928             
if ((Original_n_fate_rate == null)) {
929                 
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
930                 
this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
931             }
932             
else {
933                 
this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
934                 
this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_n_fate_rate));
935             }
936             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
937             
if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
938                         !=
global::System.Data.ConnectionState.Open)) {
939                 
this.Adapter.DeleteCommand.Connection.Open();
940             }
941             
try {
942                 
int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
943                 
return returnValue;
944             }
945             
finally {
946                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
947                     
this.Adapter.DeleteCommand.Connection.Close();
948                 }
949             }
950         }
951         
952         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
953         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
954         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
955         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
956         
public virtual int Insert(string c_fate_rate, string n_fate_rate) {
957             
if ((c_fate_rate == null)) {
958                 
this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value;
959             }
960             
else {
961                 
this.Adapter.InsertCommand.Parameters[0].Value = ((string)(c_fate_rate));
962             }
963             
if ((n_fate_rate == null)) {
964                 
this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
965             }
966             
else {
967                 
this.Adapter.InsertCommand.Parameters[1].Value = ((string)(n_fate_rate));
968             }
969             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
970             
if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
971                         !=
global::System.Data.ConnectionState.Open)) {
972                 
this.Adapter.InsertCommand.Connection.Open();
973             }
974             
try {
975                 
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
976                 
return returnValue;
977             }
978             
finally {
979                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
980                     
this.Adapter.InsertCommand.Connection.Close();
981                 }
982             }
983         }
984         
985         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
986         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
987         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
988         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
989         
public virtual int Update(string c_fate_rate, string n_fate_rate, int Original_Id, string Original_c_fate_rate, string Original_n_fate_rate, int Id) {
990             
if ((c_fate_rate == null)) {
991                 
this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value;
992             }
993             
else {
994                 
this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(c_fate_rate));
995             }
996             
if ((n_fate_rate == null)) {
997                 
this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
998             }
999             
else {
1000                 
this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(n_fate_rate));
1001             }
1002             
this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(Original_Id));
1003             
if ((Original_c_fate_rate == null)) {
1004                 
this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(1));
1005                 
this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
1006             }
1007             
else {
1008                 
this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(0));
1009                 
this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_c_fate_rate));
1010             }
1011             
if ((Original_n_fate_rate == null)) {
1012                 
this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(1));
1013                 
this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value;
1014             }
1015             
else {
1016                 
this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(0));
1017                 
this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Original_n_fate_rate));
1018             }
1019             
this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(Id));
1020             
global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
1021             
if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
1022                         !=
global::System.Data.ConnectionState.Open)) {
1023                 
this.Adapter.UpdateCommand.Connection.Open();
1024             }
1025             
try {
1026                 
int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
1027                 
return returnValue;
1028             }
1029             
finally {
1030                 
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
1031                     
this.Adapter.UpdateCommand.Connection.Close();
1032                 }
1033             }
1034         }
1035         
1036         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1037         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1038         
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
1039         
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
1040         
public virtual int Update(string c_fate_rate, string n_fate_rate, int Original_Id, string Original_c_fate_rate, string Original_n_fate_rate) {
1041             
return this.Update(c_fate_rate, n_fate_rate, Original_Id, Original_c_fate_rate, Original_n_fate_rate, Original_Id);
1042         }
1043     }

1044     
1045     ///
<summary>
1046     ///
TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
1047     ///</summary>

1048     
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
1049     
[global::System.ComponentModel.ToolboxItem(true)]
1050     [
global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
1051         
"esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
1052     
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
1053     
public partial class TableAdapterManager : global::System.ComponentModel.Component {
1054         
1055         
private UpdateOrderOption _updateOrder;
1056         
1057         
private rateTableAdapter _rateTableAdapter;
1058         
1059         
private bool _backupDataSetBeforeUpdate;
1060         
1061         
private global::System.Data.IDbConnection _connection;
1062         
1063         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1064         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1065         
public UpdateOrderOption UpdateOrder {
1066             
get {
1067                 
return this._updateOrder;
1068             }
1069             
set {
1070                 
this._updateOrder = value;
1071             }
1072         }
1073         
1074         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1075         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1076         [
global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
1077             
"ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
1078             
"a", "System.Drawing.Design.UITypeEditor")]
1079         
public rateTableAdapter rateTableAdapter {
1080             
get {
1081                 
return this._rateTableAdapter;
1082             }
1083             
set {
1084                 
this._rateTableAdapter = value;
1085             }
1086         }
1087         
1088         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1089         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1090         
public bool BackupDataSetBeforeUpdate {
1091             
get {
1092                 
return this._backupDataSetBeforeUpdate;
1093             }
1094             
set {
1095                 
this._backupDataSetBeforeUpdate = value;
1096             }
1097         }
1098         
1099         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1100         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1101         
[global::System.ComponentModel.Browsable(false)]
1102         
public global::System.Data.IDbConnection Connection {
1103             
get {
1104                 
if ((this._connection != null)) {
1105                     
return this._connection;
1106                 }
1107                 
if (((this._rateTableAdapter != null)
1108                             && (
this._rateTableAdapter.Connection != null))) {
1109                     
return this._rateTableAdapter.Connection;
1110                 }
1111                 
return null;
1112             }
1113             
set {
1114                 
this._connection = value;
1115             }
1116         }
1117         
1118         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1119         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1120         
[global::System.ComponentModel.Browsable(false)]
1121         
public int TableAdapterInstanceCount {
1122             
get {
1123                 
int count = 0;
1124                 
if ((this._rateTableAdapter != null)) {
1125                     count = (count +
1);
1126                 }
1127                 
return count;
1128             }
1129         }

1130         
1131         ///
<summary>
1132         ///
Update rows in top-down order.
1133         ///</summary>

1134         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1135         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1136         
private int UpdateUpdatedRows(milkdairyDataSet3 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1137             
int result = 0;
1138             
if ((this._rateTableAdapter != null)) {
1139                 
global::System.Data.DataRow[] updatedRows = dataSet.rate.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
1140                 updatedRows =
this.GetRealUpdatedRows(updatedRows, allAddedRows);
1141                 
if (((updatedRows != null)
1142                             && (
0 < updatedRows.Length))) {
1143                     result = (result +
this._rateTableAdapter.Update(updatedRows));
1144                     allChangedRows.AddRange(updatedRows);
1145                 }
1146             }
1147             
return result;
1148         }

1149         
1150         ///
<summary>
1151         ///
Insert rows in top-down order.
1152         ///</summary>

1153         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1154         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1155         
private int UpdateInsertedRows(milkdairyDataSet3 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1156             
int result = 0;
1157             
if ((this._rateTableAdapter != null)) {
1158                 
global::System.Data.DataRow[] addedRows = dataSet.rate.Select(null, null, global::System.Data.DataViewRowState.Added);
1159                 
if (((addedRows != null)
1160                             && (
0 < addedRows.Length))) {
1161                     result = (result +
this._rateTableAdapter.Update(addedRows));
1162                     allAddedRows.AddRange(addedRows);
1163                 }
1164             }
1165             
return result;
1166         }

1167         
1168         ///
<summary>
1169         ///
Delete rows in bottom-up order.
1170         ///</summary>

1171         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1172         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1173         
private int UpdateDeletedRows(milkdairyDataSet3 dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
1174             
int result = 0;
1175             
if ((this._rateTableAdapter != null)) {
1176                 
global::System.Data.DataRow[] deletedRows = dataSet.rate.Select(null, null, global::System.Data.DataViewRowState.Deleted);
1177                 
if (((deletedRows != null)
1178                             && (
0 < deletedRows.Length))) {
1179                     result = (result +
this._rateTableAdapter.Update(deletedRows));
1180                     allChangedRows.AddRange(deletedRows);
1181                 }
1182             }
1183             
return result;
1184         }

1185         
1186         ///
<summary>
1187         ///
Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
1188         ///</summary>

1189         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1190         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1191         
private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
1192             
if (((updatedRows == null)
1193                         || (updatedRows.Length <
1))) {
1194                 
return updatedRows;
1195             }
1196             
if (((allAddedRows == null)
1197                         || (allAddedRows.Count <
1))) {
1198                 
return updatedRows;
1199             }
1200             
global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1201             
for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
1202                 
global::System.Data.DataRow row = updatedRows[i];
1203                 
if ((allAddedRows.Contains(row) == false)) {
1204                     realUpdatedRows.Add(row);
1205                 }
1206             }
1207             
return realUpdatedRows.ToArray();
1208         }

1209         
1210         ///
<summary>
1211         ///
Update all changes to the dataset.
1212         ///</summary>

1213         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1214         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1215         
public virtual int UpdateAll(milkdairyDataSet3 dataSet) {
1216             
if ((dataSet == null)) {
1217                 
throw new global::System.ArgumentNullException("dataSet");
1218             }
1219             
if ((dataSet.HasChanges() == false)) {
1220                 
return 0;
1221             }
1222             
if (((this._rateTableAdapter != null)
1223                         && (
this.MatchTableAdapterConnection(this._rateTableAdapter.Connection) == false))) {
1224                 
throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
1225                         
"tring.");
1226             }
1227             
global::System.Data.IDbConnection workConnection = this.Connection;
1228             
if ((workConnection == null)) {
1229                 
throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
1230                         
"ger TableAdapter property to a valid TableAdapter instance.");
1231             }
1232             
bool workConnOpened = false;
1233             
if (((workConnection.State & global::System.Data.ConnectionState.Broken)
1234                         ==
global::System.Data.ConnectionState.Broken)) {
1235                 workConnection.Close();
1236             }
1237             
if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
1238                 workConnection.Open();
1239                 workConnOpened =
true;
1240             }
1241             
global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
1242             
if ((workTransaction == null)) {
1243                 
throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
1244                         
"ctions or the current state is not allowing the transaction to begin.");
1245             }
1246             
global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1247             
global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
1248             
global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
1249             
global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
1250             
int result = 0;
1251             
global::System.Data.DataSet backupDataSet = null;
1252             
if (this.BackupDataSetBeforeUpdate) {
1253                 backupDataSet =
new global::System.Data.DataSet();
1254                 backupDataSet.Merge(dataSet);
1255             }
1256             
try {
1257                 
// ---- Prepare for update -----------
1258                 
//
1259                 
if ((this._rateTableAdapter != null)) {
1260                     revertConnections.Add(
this._rateTableAdapter, this._rateTableAdapter.Connection);
1261                     
this._rateTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
1262                     
this._rateTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
1263                     
if (this._rateTableAdapter.Adapter.AcceptChangesDuringUpdate) {
1264                         
this._rateTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
1265                         adaptersWithAcceptChangesDuringUpdate.Add(
this._rateTableAdapter.Adapter);
1266                     }
1267                 }
1268                 
//
1269                 
//---- Perform updates -----------
1270                 
//
1271                 
if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
1272                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1273                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1274                 }
1275                 
else {
1276                     result = (result +
this.UpdateInsertedRows(dataSet, allAddedRows));
1277                     result = (result +
this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
1278                 }
1279                 result = (result +
this.UpdateDeletedRows(dataSet, allChangedRows));
1280                 
//
1281                 
//---- Commit updates -----------
1282                 
//
1283                 workTransaction.Commit();
1284                 
if ((0 < allAddedRows.Count)) {
1285                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1286                     allAddedRows.CopyTo(rows);
1287                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1288                         
global::System.Data.DataRow row = rows[i];
1289                         row.AcceptChanges();
1290                     }
1291                 }
1292                 
if ((0 < allChangedRows.Count)) {
1293                     
global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
1294                     allChangedRows.CopyTo(rows);
1295                     
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1296                         
global::System.Data.DataRow row = rows[i];
1297                         row.AcceptChanges();
1298                     }
1299                 }
1300             }
1301             
catch (global::System.Exception ex) {
1302                 workTransaction.Rollback();
1303                 
// ---- Restore the dataset -----------
1304                 
if (this.BackupDataSetBeforeUpdate) {
1305                     
global::System.Diagnostics.Debug.Assert((backupDataSet != null));
1306                     dataSet.Clear();
1307                     dataSet.Merge(backupDataSet);
1308                 }
1309                 
else {
1310                     
if ((0 < allAddedRows.Count)) {
1311                         
global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
1312                         allAddedRows.CopyTo(rows);
1313                         
for (int i = 0; (i < rows.Length); i = (i + 1)) {
1314                             
global::System.Data.DataRow row = rows[i];
1315                             row.AcceptChanges();
1316                             row.SetAdded();
1317                         }
1318                     }
1319                 }
1320                 
throw ex;
1321             }
1322             
finally {
1323                 
if (workConnOpened) {
1324                     workConnection.Close();
1325                 }
1326                 
if ((this._rateTableAdapter != null)) {
1327                     
this._rateTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._rateTableAdapter]));
1328                     
this._rateTableAdapter.Transaction = null;
1329                 }
1330                 
if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
1331                     
global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
1332                     adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
1333                     
for (int i = 0; (i < adapters.Length); i = (i + 1)) {
1334                         
global::System.Data.Common.DataAdapter adapter = adapters[i];
1335                         adapter.AcceptChangesDuringUpdate =
true;
1336                     }
1337                 }
1338             }
1339             
return result;
1340         }
1341         
1342         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1343         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1344         
protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
1345             
global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
1346         }
1347         
1348         
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1349         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1350         
protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
1351             
if ((this._connection != null)) {
1352                 
return true;
1353             }
1354             
if (((this.Connection == null)
1355                         || (inputConnection ==
null))) {
1356                 
return true;
1357             }
1358             
if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
1359                 
return true;
1360             }
1361             
return false;
1362         }

1363         
1364         ///
<summary>
1365         ///
Update Order Option
1366         ///</summary>

1367         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1368         
public enum UpdateOrderOption {
1369             
1370             InsertUpdateDelete =
0,
1371             
1372             UpdateInsertDelete =
1,
1373         }

1374         
1375         ///
<summary>
1376         ///
Used to sort self-referenced table's rows
1377         ///</summary>

1378         
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1379         
private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
1380             
1381             
private global::System.Data.DataRelation _relation;
1382             
1383             
private int _childFirst;
1384             
1385             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1386             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1387             
internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
1388                 
this._relation = relation;
1389                 
if (childFirst) {
1390                     
this._childFirst = -1;
1391                 }
1392                 
else {
1393                     
this._childFirst = 1;
1394                 }
1395             }
1396             
1397             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1398             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1399             
private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) {
1400                 
global::System.Diagnostics.Debug.Assert((row != null));
1401                 
global::System.Data.DataRow root = row;
1402                 distance =
0;
1403
1404                 
global::System.Collections.Generic.IDictionary<global::System.Data.DataRow, global::System.Data.DataRow> traversedRows = new global::System.Collections.Generic.Dictionary<global::System.Data.DataRow, global::System.Data.DataRow>();
1405                 traversedRows[row] = row;
1406
1407                 
global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
1408                 
for (
1409                 ; ((parent !=
null)
1410                             && (traversedRows.ContainsKey(parent) ==
false));
1411                 ) {
1412                     distance = (distance +
1);
1413                     root = parent;
1414                     traversedRows[parent] = parent;
1415                     parent = parent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Default);
1416                 }
1417
1418                 
if ((distance == 0)) {
1419                     traversedRows.Clear();
1420                     traversedRows[row] = row;
1421                     parent = row.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Original);
1422                     
for (
1423                     ; ((parent !=
null)
1424                                 && (traversedRows.ContainsKey(parent) ==
false));
1425                     ) {
1426                         distance = (distance +
1);
1427                         root = parent;
1428                         traversedRows[parent] = parent;
1429                         parent = parent.GetParentRow(
this._relation, global::System.Data.DataRowVersion.Original);
1430                     }
1431                 }
1432
1433                 
return root;
1434             }
1435             
1436             
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1437             
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
1438             
public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
1439                 
if (object.ReferenceEquals(row1, row2)) {
1440                     
return 0;
1441                 }
1442                 
if ((row1 == null)) {
1443                     
return -1;
1444                 }
1445                 
if ((row2 == null)) {
1446                     
return 1;
1447                 }
1448
1449                 
int distance1 = 0;
1450                 
global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1);
1451
1452                 
int distance2 = 0;
1453                 
global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2);
1454
1455                 
if (object.ReferenceEquals(root1, root2)) {
1456                     
return (this._childFirst * distance1.CompareTo(distance2));
1457                 }
1458                 
else {
1459                     
global::System.Diagnostics.Debug.Assert(((root1.Table != null)
1460                                     && (root2.Table !=
null)));
1461                     
if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) {
1462                         
return -1;
1463                     }
1464                     
else {
1465                         
return 1;
1466                     }
1467                 }
1468             }
1469         }
1470     }
1471 }
1472
1473 #pragma warning restore
1591


Gõ tìm kiếm nhanh...